<?php

class ZendTremplin_Server_AuthentificationServer {

    /**
     *
     * @param string $username
     * @param string $pwd
     * @return string 
     */
    public function connection($username, $pwd) {
        $mapper = new ZendTremplin_Model_UserMapper();
        if($mapper->isRightCombination($username, $pwd)) {
            $result = array(
                'result' => 'success'
            );
        }
        else {
            $result = array(
                'result' => 'error',
                'error' => 'Authentification error'
            );
        }
        
        return Zend_Json::encode($result);
    }

}

